<?php $theme = "front"; ?>
<!--blog-->
<div class="blog">
    <div class="container">
        <div class="blog-head heading">
            <h1><?php echo $newsClass['sortname'] ?></h1>
        </div>	
        <div class="blog-top">
            <div class="col-md-9 blog-left">
                <?php foreach ($news as $nk => $nv) { ?>
                    <div class="blog-main">
                        <a href="<?php echo base_url($this->_site_path . '/news/single/' . $nv['id']); ?>" class="bg" target="_blank"><?php echo $nv['title'] ?></a>
                    </div>
                    <div class="blog-main-one">
                        <div class="blog-one">
                            <?php if ($nv['imagemark']): ?>
                                <div class="col-md-3 blog-one-left">
                                    <a href="<?php echo base_url($this->_site_path . '/news/single/' . $nv['id']); ?>" target="_blank"><img src="<?php echo image(base_url() . $nv['imagemark'], $theme) ?>" alt="" /></a>
                                </div>
                            <?php endif; ?>
                            <div class="col-md-7 blog-one-left">
                                <p><?php echo $nv['description'] ?></p>
                                <div class="b-btn">
                                    <a href="<?php echo base_url($this->_site_path . '/news/single/' . $nv['id']); ?>" target="_blank">more</a>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>	
                        <div class="blog-comments">
                            <ul>
                                <li><span class="glyphicon glyphicon-bookmark" aria-hidden="true"></span>来源：<?php echo $nv['article_source'] ?></li>
                                <li><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span><p>浏览次数：<?php echo $nv['clickcount'] ?></p></li>
                                <li><span class="glyphicon glyphicon-user" aria-hidden="true"></span><a href="#">时间：<?php echo date('Y-m-d', $nv['modified']); ?></a></li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>	
                    </div>
                <?php } ?>
            </div>
            <div class="col-md-3 blog-right">
                <?php
                $fields = array('id', 'sortname');
                $search['attributes']['parentid'] = 0;
                $classInfo = $this->news_class_model->get_appoint_values($fields, null, $search);
                foreach ($classInfo as $ck => $cv) {
                    echo '<div class="categories">';
                    echo '<h3>' . $cv['sortname'] . '</h3>';
                    echo '<ul>';
                    $search['attributes']['parentid'] = $cv['id'];
                    $childInfo = $this->news_class_model->get_appoint_values($fields, null, $search);
                    foreach ($childInfo as $key => $value) {
                        echo '<li><a href = "' . base_url($this->_site_path . '/news/index/' . $value['id']) . '">' . $value['sortname'] . '</a></li>';
                    }
                    echo '</ul>';
                    echo '</div>';
                }
                ?>
                <div class = "categories">
                    <h3>服务保障</h3>
                    <ul>
                        <?php
                        $fields = array('id', 'title');
                        $search['attributes']['parentid'] = 3;
                        $serviceInfo = $this->news_model->get_appoint_values($fields, null, $search);
                        foreach ($serviceInfo as $s) {
                            echo '<li><a href = "' . base_url($this->_site_path . '/news/single/' . $s['id']) . '">' . $s['title'] . '</a></li>';
                        }
                        ?>
                    </ul>
                </div>
            </div>
            <div class = "clearfix"></div>
        </div>
        <div class = "pagenatin">
            <div class = "col-md-6">
                <nav>
                    <?php echo $pagination;
                    ?>
                </nav>
            </div>
        </div>
    </div>
</div>
<!--blog-->